package com.house.biz.impl;

import java.util.List;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import com.house.biz.DisasUserBiz;
import com.house.biz.HouseBiz;
import com.house.dao.DisasUserDao;
import com.house.entity.DisasUser;
import com.house.entity.District;
import com.house.entity.House;
import com.house.entity.User;
@Service("disasUserBiz")
public class DisasUserBizImpl implements DisasUserBiz{

	@Autowired
	private DisasUserDao disasUserDao;
	public List<DisasUser> getAll(int id) {
		return disasUserDao.getAll(id);
	}

	@Test
	public void sda(){
		ApplicationContext context=new ClassPathXmlApplicationContext("beans.xml");
		HouseBiz houseBiz=(HouseBiz) context.getBean("houseBiz");
		House house=new House();
		User user=new User();
		user.setName("aaa");
		user.setPhone("123456789");
		District district=new District();
		district.setId(1);
		house.setUser(user);
		house.setDistrict(district);
		houseBiz.updateHouse(house);

	}

	public void updateDisasUser(int id, String securityPhone) {
		// TODO Auto-generated method stub
		disasUserDao.updateDisasUser(id, securityPhone);
	}

	public void updateDisasUser1(int id, String phone) {
		// TODO Auto-generated method stub
		disasUserDao.updateDisasUser1(id, phone);
	}


}
